#ifndef CUBERIGIDBODYTEST_H_
#define CUBERIGIDBODYTEST_H_

#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>

#include "../src/RigidBody.h"
#include "../src/CubeBodyShape.h"
#include "../src/shapes.h"
#include "../src/math/math.h"

using physicsworks::RigidBody;
using physicsworks::CubeBodyShape;
using physicsworks::AABox;
using physicsworks::math::vec3;
using physicsworks::math::mat3;

class CubeRigidBodyTest : public CppUnit::TestFixture
{
	CPPUNIT_TEST_SUITE(CubeRigidBodyTest);
	CPPUNIT_TEST(testBoundingBox);
	CPPUNIT_TEST_SUITE_END();
	
private:
	RigidBody* body0;

public:

	void setUp() {
		body0 = new RigidBody(new CubeBodyShape(50));
		body0->setPosition(10, 8, 0);
	}
	
	void testBoundingBox() {
		
		AABox box = body0->getBoundingBox();
		CPPUNIT_ASSERT( box.min.x == 10 - 50);
		CPPUNIT_ASSERT( box.min.y ==  8 - 50);
		CPPUNIT_ASSERT( box.min.z ==  0 - 50);
		CPPUNIT_ASSERT( box.max.x == 10 + 50);
		CPPUNIT_ASSERT( box.max.y ==  8 + 50);
		CPPUNIT_ASSERT( box.max.z ==  0 + 50);
	}
	
	void tearDown() {
		delete body0;
	}
};

#endif /*CUBERIGIDBODYTEST_H_*/
